import React, { Component } from 'react';
import Marquee from './modules/index';
import style from './index.less';

class MarqueePage extends Component {
  constructor(props, context) {
    super(props, context);
    this.state = {
      loopData: [],
    };
  }
  render() {
    let { loopData } = this.props;
    return (
      <div className={style.marquee_class}>
        <div className='box-landscape'>
          <Marquee loopData={loopData} getMarquee={this.getLandscapeMarquee} />
        </div>
      </div>
    );
  }

  // 横向
  getLandscapeMarquee = (params) => {
    this.landscapeMarqueeParams = params;
  };

  stoplandscapeMarquee = () => {
    this.landscapeMarqueeParams.stopMarquee();
  };

  runlandscapeMarquee = () => {
    this.landscapeMarqueeParams.runMarquee();
  };

  //竖向
  getVerticalMarquee = (params) => {
    this.verticalMarqueeParams = params;
  };

  stopVerticalMarquee = () => {
    this.verticalMarqueeParams.stopMarquee();
  };

  runVerticalMarquee = () => {
    this.verticalMarqueeParams.runMarquee();
  };
}

export default MarqueePage;
